package com.gyk.orderss.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gyk.orderss.dao.TbOrderMapper;
import com.gyk.orderss.pojo.TbOrder;
import com.gyk.orderss.service.TbOrderService;
import org.springframework.stereotype.Service;

@Service
public class TbOrderServiceImpl extends ServiceImpl<TbOrderMapper, TbOrder> implements TbOrderService {

    public PageInfo<TbOrder> page(String title,Integer pageNum, Integer pageSize){
        if(null==pageNum) {
            pageNum = 1;
        }if(null!=title&&!"".equals(title)){
            title = "%"+title+"%";
        }
        if(null==pageSize){
            pageSize=5;
        }
        PageHelper.startPage(pageNum,pageSize);
        PageInfo<TbOrder> pageInfo = new PageInfo<TbOrder>(baseMapper.lookOrder(title));
        return pageInfo;
    }

}
